<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: most_search.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$search_sort = $db->db_query_limit("SELECT
										search_count,
										search_result,
										search_text
									FROM
										".TABLE_SEARCH_QUERIES_SORTED."
									ORDER BY
										search_count DESC", 10, true);
$i = 0;
if($search_sort->_numOfRows ){ ?>
	<table width="100%" class="dataTable">
		<tr>
			<td width="1px"><?php echo TEXT_WIDGET_MS_RANK ?></td>
			<td><?php echo TEXT_WIDGET_MS_TERM ?></td>
			<td align="center"><?php echo TEXT_WIDGET_MS_NUMBER ?></td>
			<td align="center"><?php echo TEXT_WIDGET_MS_HITS ?></td>
		</tr>
	<?php
	while(!$search_sort->EOF){
	$i++;?>
		<tr>
			<td align="center"><?php echo ($i) ?></td>
			<td><?php echo $search_sort->fields['search_text'] ?></td>
			<td  align="center"><?php echo $search_sort->fields['search_count'] ?></td>
			<td  align="center"><?php echo $search_sort->fields['search_result'] ?></td>
		</tr>
	<?php $search_sort->MoveNext();
		}?>
	</table><br />
<?php
}
else
	echo '	<div class="rss_item"><p><em>Es wurde noch nichts gesucht oder die Statistik ist deaktiviert.</em><br /><br />
			Die Aufzeichnung der Suchbegriffe können Sie <a href="'.href_link(FILENAME_CONFIGURATION, 'gID=10&'.getMenuID('configuration')).'" >hier</a> starten. Die Suchstatistik können Sie <a href="'.href_link(FILENAME_STATS_KEYWORDS_ALL, getMenuID('stats_keywords_all')).'">hier</a> aktualisieren.</p></div>';
?>

<div class="ar">
	<?php
	echo draw_form('delete', 'stats_keywords_all.php?widget=1');
		echo draw_hidden_field('action','deletedb');
		?>
		<button type="submit" class="button">Statistik leeren</button>
	</form>
	<?php
	echo draw_form('update', 'stats_keywords_all.php?widget=1');
		echo draw_hidden_field('action','updatedb');
		echo draw_hidden_field('page','1');
		?>
		<button type="submit" class="button">Statistik updaten</button>
	</form>
</div>